//
//  PeopleOneCell.m
//  JinChengYun
//
//  Created by 金橙云 on 2017/4/24.
//  Copyright © 2017年 金橙云. All rights reserved.
//

#import "PeopleOneCell.h"

#import "UIImageView+WebCache.h"
@implementation PeopleOneCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        _headImg = [[UIImageView alloc] init];
       // _headImg.layer.cornerRadius = 30;
       // _headImg.backgroundColor = [UIColor redColor];
        [self addSubview:_headImg];
        [_headImg mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(60);
            make.top.equalTo(self.mas_top).offset(10);
            make.left.equalTo(self.mas_left).offset(10);
        }];
        
        _nameLab = [[UILabel alloc] init];
        _nameLab.text = @"你好!小花";
        _nameLab.font = [UIFont systemFontOfSize:16];
        _nameLab.textAlignment = NSTextAlignmentLeft;
        [self addSubview:_nameLab];
        [_nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(200, 30));
            make.left.equalTo(_headImg.mas_right).offset(20);
            make.centerY.equalTo(self.mas_centerY);
        }];
    }
    return self;
}
-(void)setupPeopleCellWithHeaderImage:(NSString *)_img withNickName:(NSString *)_name
{
    if (_img.length>0)
    {
        [_headImg sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",_img]] placeholderImage:[UIImage imageNamed:@"Me_header"]];
    }
    _nameLab.text = [NSString stringWithFormat:@" 您好!%@",_name.length>0?_name:@""];
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
